home *** CD-ROM | disk | FTP | other *** search
- on SetPDCFlags theFlag, theValue
- global calcdata, oldest, youngest, gDirty
- set gDirty to 1
- validatePDCScreen()
- setaProp(calcdata, theFlag, theValue)
- if theFlag = #none then
- setaProp(calcdata, #diabetes, 0)
- setaProp(calcdata, #heart, 0)
- setaProp(calcdata, #preg, 0)
- setaProp(calcdata, #hypr, 0)
- setaProp(calcdata, #vegt, 0)
- setaProp(calcdata, #under_19, 0)
- setaProp(calcdata, #low_fat, 0)
- else
- put "something has been checked"
- if theFlag = #vegt then
- put "veg checked"
- if getaProp(calcdata, #brk_meat) then
- put "break meat checked"
- set x to 12
- set notDone to 1
- repeat while notDone
- if getAt(calcdata, x) = 0 then
- setAt(calcdata, x, 1)
- if oldest = #brk_meat then
- set oldest to getPropAt(calcdata, x)
- else
- if youngest = #brk_meat then
- set youngest to getPropAt(calcdata, x)
- end if
- end if
- set notDone to 0
- next repeat
- end if
- set x to x + 1
- end repeat
- setaProp(calcdata, #brk_meat, 0)
- end if
- if getaProp(calcdata, #lun_meat) then
- setaProp(calcdata, #lun_meat, 0)
- setaProp(calcdata, #lun_pasta, 1)
- end if
- setaProp(calcdata, #din_meat, 0)
- setaProp(calcdata, #din_pasta, 1)
- else
- if theFlag = #low_fat then
- if getaProp(calcdata, #brk_meat) then
- set x to 12
- set notDone to 1
- repeat while notDone
- if getAt(calcdata, x) = 0 then
- setAt(calcdata, x, 1)
- if oldest = #brk_meat then
- set oldest to getPropAt(calcdata, x)
- else
- if youngest = #brk_meat then
- set youngest to getPropAt(calcdata, x)
- end if
- end if
- set notDone to 0
- next repeat
- end if
- set x to x + 1
- end repeat
- setaProp(calcdata, #brk_meat, 0)
- end if
- end if
- end if
- setaProp(calcdata, #none, 0)
- end if
- setPDCNoFatFromArray()
- updateStage()
- end
-
- on setFatPercentFlag theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- validatePDCScreen()
- setaProp(calcdata, theFlag, theValue)
- setFatPercentFromArray()
- updateStage()
- end
-
- on setLunchGroup1Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #lun_meat, 0)
- setaProp(calcdata, #lun_pasta, 0)
- setaProp(calcdata, #lun_sand, 0)
- setaProp(calcdata, theFlag, theValue)
- setLunchGroup1FromArray()
- updateStage()
- end
-
- on setLunchGroup2Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #lun_soup, 0)
- setaProp(calcdata, #lun_salad, 0)
- setaProp(calcdata, theFlag, theValue)
- setLunchGroup2FromArray()
- updateStage()
- end
-
- on setLunchGroup3Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #lun_fruit, 0)
- setaProp(calcdata, #lun_juice, 0)
- setaProp(calcdata, theFlag, theValue)
- setLunchGroup3FromArray()
- updateStage()
- end
-
- on setLunchGroup4Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #lun_milk, 0)
- setaProp(calcdata, #lun_cheese, 0)
- setaProp(calcdata, theFlag, theValue)
- setLunchGroup4FromArray()
- updateStage()
- end
-
- on setBreakfastGroup1Flags theFlag, theValue
- global calcdata, oldest, youngest, gDirty
- set gDirty to 1
- if theValue = 1 then
- setaProp(calcdata, oldest, 0)
- set oldest to youngest
- set youngest to theFlag
- end if
- setaProp(calcdata, theFlag, theValue)
- setBreakfastGroup1FromArray()
- updateStage()
- end
-
- on setBreakfastGroup2Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #brk_fruit, 0)
- setaProp(calcdata, #brk_juice, 0)
- setaProp(calcdata, theFlag, theValue)
- setBreakfastGroup2FromArray()
- updateStage()
- end
-
- on SetDinnerGroup1Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #din_meat, 0)
- setaProp(calcdata, #din_pasta, 0)
- setaProp(calcdata, theFlag, theValue)
- setDinnerGroup1FromArray()
- updateStage()
- end
-
- on SetDinnerGroup2Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #din_bread, 0)
- setaProp(calcdata, #din_potatoes, 0)
- setaProp(calcdata, theFlag, theValue)
- setDinnerGroup2FromArray()
- updateStage()
- end
-
- on SetDinnerGroup3Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, #din_soup, 0)
- setaProp(calcdata, #din_salad, 0)
- setaProp(calcdata, theFlag, theValue)
- setDinnerGroup3FromArray()
- updateStage()
- end
-
- on SetDinnerGroup4Flags theFlag, theValue
- global calcdata, gDirty
- set gDirty to 1
- setaProp(calcdata, theFlag, theValue)
- setDinnerGroup4FromArray()
- updateStage()
- end
-